#ifndef __HARDWARE_H__
#define __HARDWARE_H__

#include <at32f4xx.h>


#define LCD_BL_PIN                	GPIO_Pins_1
#define LCD_BL_GPIO_PORT            GPIOB
#define LCD_BL_GPIO_RCC_CLK       	RCC_AHBPERIPH_GPIOB


#define PWR_HOLD_PIN                GPIO_Pins_4
#define PWR_HOLD_GPIO_PORT          GPIOA
#define PWR_HOLD_GPIO_RCC_CLK       RCC_AHBPERIPH_GPIOA


#define KEY_UP_PIN                	GPIO_Pins_0
#define KEY_UP_GPIO_PORT            GPIOF
#define KEY_UP_GPIO_RCC_CLK       	RCC_AHBPERIPH_GPIOF

#define KEY_DOWN_PIN                GPIO_Pins_1
#define KEY_DOWN_GPIO_PORT          GPIOF
#define KEY_DOWN_GPIO_RCC_CLK       RCC_AHBPERIPH_GPIOF

#define KEY_PWR_PIN                	GPIO_Pins_3
#define KEY_PWR_GPIO_PORT           GPIOA
#define KEY_PWR_GPIO_RCC_CLK       	RCC_AHBPERIPH_GPIOA


#define LCD_BL_OFF 	LCD_BL_GPIO_PORT->BRE  = LCD_BL_PIN		//	ResetBits
#define LCD_BL_ON		LCD_BL_GPIO_PORT->BSRE = LCD_BL_PIN		//	SetBits


#define PWR_HOLD_OFF 	PWR_HOLD_GPIO_PORT->BRE  = PWR_HOLD_PIN		//	ResetBits
#define PWR_HOLD_ON		PWR_HOLD_GPIO_PORT->BSRE = PWR_HOLD_PIN		//	SetBits




void hardware_Init(void);
uint8_t KEY_UP_State(void);
uint8_t KEY_DOWN_State(void);




#endif
